//
//  BuyArtTicketRequest.m
//  EasyToo
//
//  Created by zhengzhe on 13-8-25.
//
//

#import "BuyArtTicketRequest.h"

@implementation BuyArtTicketRequest

- (id)initBuyArtTicketInfo:(id<ServerCommunicationDelegate>)delegate
                  quantity:(NSString*)quantity
               singlePrice:(NSString*)singlePrice
                    mobile:(NSString*)mobile
              customerName:(NSString*)customerName
                   priceId:(NSString*)priceId
{
    self = [super init];
    if (self) {
        self.requestName = @"BuyArtTicketRequest";
        self.delegate = delegate;
        
        NSString* date;
        NSDateFormatter* formatter = [[NSDateFormatter alloc]init];
        [formatter setDateFormat:@"YYYYMMddhhmmss"];
        date = [formatter stringFromDate:[NSDate date]];
        
        [self.bodyJsonDict setObject:@"sdf" forKey:@"areaName"];
        [self.bodyJsonDict setObject:quantity forKey:@"quantity"];
        [self.bodyJsonDict setObject:@"" forKey:@"criterion_out"];
        [self.bodyJsonDict setObject:@"v1.0" forKey:@"version"];
        [self.bodyJsonDict setObject:singlePrice forKey:@"singlePrice"];
        [self.bodyJsonDict setObject:mobile forKey:@"mobile"];
        [self.bodyJsonDict setObject:customerName forKey:@"customerName"];
        [self.bodyJsonDict setObject:priceId forKey:@"priceId"];
        [self.bodyJsonDict setObject:date forKey:@"criterion_tmark"];
        [self.bodyJsonDict setObject:@"004004" forKey:@"TranCode"];
        
        [self.headerJsonDict setObject:@"004004" forKey:@"TranCode"];
        [self buildJsonRequest];
    }
    return self;
}


@end
